package com.starry.home.ui.mine

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.starry.core.base.BaseActivity
import com.starry.core.utils.GlideUtils
import com.starry.core.utils.ZKStatusBarUtil
import com.starry.home.R
import com.starry.home.databinding.PersonActivityBinding
import com.starry.home.logic.model.login.UserInfoBean
import com.starry.home.viewmodel.main.PersonViewModel

/**
 * Package:com.starry.dotpen_patients.ui.main
 * Author:starr
 * Time:2024/2/21 11:58
 * Description: 个人信息界面
 */
class PersonActivity : BaseActivity<PersonActivityBinding, PersonViewModel>() {

    companion object {

        private lateinit var userInfo: UserInfoBean
        fun startAction(context: Context, bundle: Bundle) {

            val intent = Intent(context, PersonActivity::class.java)
            userInfo = bundle.getSerializable("userInfo") as UserInfoBean
            context.startActivity(intent)
        }
    }

    override fun initData() {

        mDataBinding.ivBack.setOnClickListener {
            finish()
        }

    }

    override fun initView() {
        ZKStatusBarUtil.setTransparentForWindow(this)
        ZKStatusBarUtil.setDarkMode(this)
        mDataBinding.tvName.text = userInfo.emrHzName
        mDataBinding.tvSex.text = userInfo.emrHzSex
        mDataBinding.tvPhone.text = userInfo.emrHzPhone
        mDataBinding.tvBirth.text = userInfo.emrHzBirth
        GlideUtils.loadCircleImage(context = getContext(), userInfo.emrHzImg, mDataBinding.ivUser)
        mDataBinding.tvJob.text = userInfo.emrHzJob
    }


    override fun getLayoutId() = R.layout.person_activity
}